<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools"/>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" type="text/css" href="${webRoot}/plug-in/fancybox/fancybox/jquery.fancybox-1.3.4.css"
      media="screen"/>
<div class="easyui-layout" fit="true" id="main_questList">
    <div region="center" style="padding:1px;">
        <t:datagrid name="consultantList" title="" actionUrl="consultantController.do?datagrid" idField="consultantId"
                    fit="true"
                    queryMode="group" onLoadSuccess="bandImg">
            <t:dgCol title="consultantId" field="consultantId" hidden="true"></t:dgCol>
            <t:dgCol title="咨询师头像" field="aCustomerEntity.avatar" extendParams="formatter:avatarFormatter;"
                     align="center"></t:dgCol>
            <t:dgCol title="姓名" field="aCustomerEntity.realname" query="true" width="1"></t:dgCol>
            <t:dgCol title="性别" field="aCustomerEntity.sex" dictionary="sex" width="1"></t:dgCol>
            <t:dgCol title="手机号码" field="aCustomerEntity.phone" query="true" width="1"></t:dgCol>
            <t:dgCol title="生日" field="aCustomerEntity.birthday" formatter="yyyy-MM-dd" query="true" width="1"></t:dgCol>
            <t:dgCol title="省" field="aCustomerEntity.province" width="1"></t:dgCol>
            <t:dgCol title="市" field="aCustomerEntity.city" width="1"></t:dgCol>
            <t:dgCol title="区" field="aCustomerEntity.area" width="1"></t:dgCol>
            <t:dgCol title="专家等级" field="isExpert" dictionary="isexpert" width="1"></t:dgCol>
            <t:dgCol title="状态" field="isAuth" query="true" dictionary="newapply" width="2"></t:dgCol>

            <t:dgCol title="common.operation" field="opt" width="1"></t:dgCol>
            <t:dgFunOpt funname="showCourseSeries(consultantId,aCustomerEntity.realname)" title="课程系列"></t:dgFunOpt>


        </t:datagrid>
    </div>
</div>
<div data-options="region:'east',
	title:'课程系列',
	collapsed:true,
	split:true,
	border:false,
	onExpand : function(){
		li_east = 1;
	},
	onCollapse : function() {
	    li_east = 0;
	}"
     style="width: 400px; overflow: hidden;" id="eastPanel">
    <div class="easyui-panel" style="padding: 1px;" fit="true" border="false" id="showPanel"></div>
</div>
<script type="text/javascript">
    function avatarFormatter(val, row) {
        return '<a rel="datagrid_group" href="' + val + '" title=""><img alt="" src="' + val + '" style="width:30px;height:30px;"></a>';
    }
    function bandImg() {
        $("a[rel=datagrid_group]").fancybox({
            'overlayShow': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic'
        });
    }

    function showCourseSeries(consultantId, name) {
        var title = "课程系列【" + name + "】";
        if (li_east == 0) {
            $('#main_questList').layout('expand', 'east');
        }
        $('#main_questList').layout('panel', 'east').panel('setTitle', title);
        $('#main_questList').layout('panel', 'east').panel('resize');
        $('#showPanel').panel("refresh", "ccourseController.do?seriesIndex&consultantId=" + consultantId);
    }


</script>
